using System;
using System.Collections.Generic;
using System.Text;

namespace dender.dvdcover.core
{
    /// <summary>
    /// Helper to trigger events. Checks is the event is not empty and then triggers it
    /// </summary>
    /// <typeparam name="T">Events arguments of the eventhandler</typeparam>
    static class EventTrigger<T>  where T: EventArgs
    {
        public static void Invoke(EventHandler<T> eventToTrigger, object sender, T eventArgs)
        {
            if (eventToTrigger != null)
            {
                eventToTrigger.Invoke(sender, eventArgs);
            }
        }
    }
}
